<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>充值页面</title>
</head>
<body>
您的等级为${realname}<br>
<#--<input name="qian">请进行充值！！！
<a href="/chongzhi?username=${username}">确认充值</a>-->
<form id="form">
    <h1 id="loginInfo" style="color:red;"></h1>
    <input name="username" id="username">为了您的账户安全！请再次输入您的用户名，谢谢配合<br>
    <input name="qian">请填写您的充值金额
    <button type="button" id="button" onclick="btnSubmit">确认充值！</button>

</form>
<script  src="/js/jquery.js"></script>
<script>
    $("#button").click(function(){
        //1. 获取参数.
        var data=$("#form").serialize();
        //2. 发送ajax请求.
        $.post(
            "/chongzhi",
            data,
            function (result) {
                if (result.code==0){
                    alert("您已经是会员，请进行会员权限！");
                    location.href="/list";
                } else {
                    $("#loginInfo").html(result.msg);
                }
            },
            "json"
        )
    });

</script>

</body>
</html>